package io.gitee.xyuesheng.day09;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class Main {
    public static void main(String[] args) {
        Factory factory = new Factory();

        Consumer consumer = new Consumer(factory);
        Consumer consumer2 = new Consumer(factory);
        Consumer consumer3 = new Consumer(factory);
        Producer producer = new Producer(factory);

        ExecutorService pool = Executors.newFixedThreadPool(4);
        pool.submit(consumer);
        pool.submit(consumer2);
        pool.submit(consumer3);
        pool.submit(producer);

    }
}
